# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=svt-vp9
pkgver=0.3.0
pkgrel=1
pkgdesc="Scalable Vector Technology for VP9 encoder (SVT-VP9 Encoder)"
url="https://01.org/svt"
arch="x86_64" #x86: error: incompatible type for argument 2 of '_mm_storel_epi64'
license="BSD-2-Clause-Patent"
options="!check" # No test suite from upstream
makedepends="cmake samurai yasm"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenVisualCloud/SVT-VP9/archive/v$pkgver.tar.gz"
builddir="$srcdir/SVT-VP9-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS"
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm 644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="2b65d4cc731061c2a07010314f7c306664fd9cf122917f96b94ec87350c8bab1a1118527263eb39347a6f6f572088337e1c5f7ae738b52de30a28ccb54c321c1  svt-vp9-0.3.0.tar.gz"
